//============================================================================
// Name        : Assignment2.cpp
// Author      : Thada Pipatchaoroenkij 49270325
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <string>
#include "Person.h"
#include "Truck.h"

using namespace std;
void print(const Truck&);

/**
 * main program to test all source code.
 */
int main() {
	Person driver("John");
	Truck truck1("BenZ", 100, driver, 5, 178);
	print(truck1);

	cout << endl << "After changed" << endl;
	Person driver1("David");
	truck1.setCylinders(200);
	truck1.setManufacturer("Toyota");
	truck1.setOwner(driver1);
	truck1.setPounds(800);
	truck1.setTons(10);
	print(truck1);

	return 0;
}

/**
 * To print truck profile
 * @param truck The truck object.
 */
void print(const Truck& truck){
	cout << "Truck\nManufacturer name: " << truck.getManufacturer();
	cout << "\nNumber of cylinders: " << truck.getCylinders();
	cout << "\nLoad capacity(tons): " << truck.getTons();
	cout << "\nTowing capacity(pounds): " << truck.getPounds();
	cout << "\nOwner: " << truck.getOwner().getName() << endl;
}
